Skip to content

Improve test coverage reporting and CI/CD pipeline#16

Merged
valbeat merged 4 commits into
mainfrom
feat/improve-test-coverage
Aug 9, 2025
Merged

Improve test coverage reporting and CI/CD pipeline#16
valbeat merged 4 commits into
mainfrom
feat/improve-test-coverage

Conversation

@valbeat

@valbeat valbeat commented Aug 9, 2025

Copy link
Copy Markdown
Owner

Summary

Enhance the CI/CD pipeline with better test coverage reporting using PCOV and add static analysis checks.

Changes

Coverage Improvements

  • Switch from Xdebug to PCOV: Significantly faster code coverage generation
  • Multiple output formats:
    • Clover XML for Codecov
    • HTML report for human review
    • JUnit XML for test results
  • Artifact uploads: Test results and HTML coverage reports are now available as GitHub Actions artifacts

CI/CD Pipeline Enhancements

  • Added PHPStan check: Static analysis runs before tests
  • Added PHP CS Fixer check: Code style verification
  • Structured output directories:
    • build/logs/ for XML reports
    • coverage/html/ for HTML coverage

Configuration

  • PCOV configured to analyze only src directory
  • Added /build/ to .gitignore

Benefits

  • Faster CI: PCOV is ~10x faster than Xdebug for coverage
  • 📊 Better visibility: Multiple report formats for different use cases
  • 🔍 Early detection: Static analysis and style checks catch issues before tests
  • 📁 Downloadable reports: HTML coverage available as artifacts for offline review

Test Plan

  • Validate workflow syntax
  • Verify all composer scripts exist
  • Confirm CI pipeline passes
  • Check Codecov receives coverage data
  • Verify artifacts are uploaded correctly

- XdebugからPCOVに切り替え(高速化)
- PHPStanとPHP CS Fixerチェックを追加
- テスト結果とカバレッジレポートのアーティファクト保存
- JUnit形式のテスト結果出力
- HTMLカバレッジレポート生成
- build/ディレクトリを.gitignoreに追加
Copilot AI review requested due to automatic review settings August 9, 2025 12:25
@valbeat valbeat self-assigned this Aug 9, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @valbeat, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

I've improved our CI/CD pipeline by upgrading our test coverage reporting and integrating new static analysis tools. The primary goal is to make our development process faster and more robust by catching issues earlier and providing better visibility into code quality and test results. This includes a significant speedup in coverage generation and more accessible reports.

Highlights

  • Coverage Improvements: Switched from Xdebug to PCOV for faster coverage generation, and configured multiple output formats (Clover XML, HTML, JUnit XML) with artifact uploads.
  • CI/CD Pipeline Enhancements: Integrated PHPStan for static analysis and PHP CS Fixer for code style verification, and structured output directories.
  • Configuration: PCOV is configured to analyze only the src directory, and /build/ has been added to .gitignore.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai

coderabbitai Bot commented Aug 9, 2025

Copy link
Copy Markdown

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Warning

Rate limit exceeded

@valbeat has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 31 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 96ea794 and f19481c.

📒 Files selected for processing (2)
  • .github/workflows/test.yml (1 hunks)
  • .gitignore (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/improve-test-coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the CI/CD pipeline by switching from Xdebug to PCOV for faster test coverage generation and adding static analysis checks. The changes introduce PHPStan for static analysis, PHP CS Fixer for code style verification, and multiple coverage output formats including HTML reports and JUnit XML.

Key changes:

  • Replace Xdebug with PCOV for significantly faster coverage generation
  • Add PHPStan and PHP CS Fixer checks before running tests
  • Generate multiple coverage report formats and upload them as GitHub Actions artifacts

Comment thread .github/workflows/test.yml Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly improves the CI/CD pipeline by replacing Xdebug with the faster PCOV for code coverage, and by adding static analysis (PHPStan) and code style (PHP CS Fixer) checks. The changes also introduce structured output directories for build artifacts and make reports available for download. The modification to .gitignore to exclude the new build directory is correct and aligns with the overall goal of keeping the repository clean from generated files. Overall, these are excellent enhancements for project quality and developer experience.

valbeat added 3 commits August 9, 2025 21:27
- Matrix戦略導入(将来的な複数PHPバージョン対応準備)
- ramsey/composer-installアクションで依存関係キャッシュ改善
- PCOV設定の最適化(vendor/とtests/を除外)
- Codecov v4へアップグレード
- アーティファクト保存期間を7日に設定
- エラーハンドリングの厳格化(fail_ci_if_error: true)
- PHPStanとPHP CS Fixerのチェックを削除(別ワークフローで実行推奨)
- CODECOV_TOKEN環境変数を削除(パブリックリポジトリでは不要)
- codecov/codecov-action@v5に更新(トークン不要)
- name パラメータを削除(v5で非推奨)
@codecov

codecov Bot commented Aug 9, 2025

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@valbeat valbeat merged commit b447222 into main Aug 9, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants